<template>
  <div class="mainContent">
    <a-spin :spinning="spinning">
      <div style="width:90%;margin:0 auto;">
        <p
          v-if="queryDetail.logMerchantPosp.statusName !== '审核通过'"
          style="color:#0000FF;"
        >
          <span style="font-size:20px;">{{
            queryDetail.logMerchantPosp.statusName
          }}</span>
          <span v-if="queryDetail.logMerchantPosp.remark"
            >：{{ queryDetail.logMerchantPosp.remark }}</span
          >
        </p>

        <a-row>
          <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
            >基本信息</a-col
          >
        </a-row>
        <a-form style="margin-bottom: 20px;" layout="inline">
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="会员编号"
          >
            <span class="ant-form-text">{{ queryDetail.member.memberNo }}</span>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="会员账号"
          >
            <span v-if="sensitive=='0'" class="ant-form-text">{{ queryDetail.member.username }}</span>
            <a-hide-data
              v-else
              :params="{ type: 'mobileNo', value: queryDetail.member.username }"
            ></a-hide-data>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="手机号"
          >
            <span v-if="sensitive=='0'" class="ant-form-text">{{ queryDetail.member.mobileNo }}</span>
            <a-hide-data
              v-else
              :params="{ type: 'mobileNo', value: queryDetail.member.mobileNo }"
            ></a-hide-data>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="客户类型"
          >
            <span class="ant-form-text">
              <span v-if="queryDetail.logMerchantPosp.merchantType == 'small'"
                >小微商户</span
              >
              <span v-if="queryDetail.logMerchantPosp.merchantType == 'org'"
                >企业</span
              >
              <span v-if="queryDetail.logMerchantPosp.merchantType == 'mer'"
                >个体工商户</span
              >
            </span>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="企业性质"
          >
            <span class="ant-form-text">{{
              queryDetail.logMerchantPosp.orgType
            }}</span>
          </a-form-item>
          <a-form-item class="formItemWidth">
            <span class="ant-form-text"></span>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="客户名称"
          >
            <span class="ant-form-text">{{
              queryDetail.logMerchantPosp.merchantName
            }}</span>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="客户简称"
          >
            <span class="ant-form-text">{{
              queryDetail.logMerchantPosp.shortName
            }}</span>
          </a-form-item>

        <!--
          <a-form-item
            v-if="!isOrg"
            class="formItemWidth"
            v-bind="formItemLayout"
            label="实际经营地址"
          >
            <span
            class="ant-form-text">{{queryDetail.logMerchantPosp.realProvinceName}}--{{queryDetail.logMerchantPosp.realCityName}}--{{queryDetail.logMerchantPosp.realDistrictName}}--{{queryDetail.logMerchantPosp.realAddress}}</span>
            <span class="ant-form-text">{{
              queryDetail.logMerchantPosp.realAddress
            }}</span>
          </a-form-item>-->

          <!-- <a-form-item v-if="isOrg" class="formItemWidth" v-bind="formItemLayout" label="所属行业">
            <span class="ant-form-text">{{queryDetail.logMerchantPosp.industryCategoryName}}</span>
          </a-form-item>-->
          <div v-if="isOrg">
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >经营信息</a-col
              >
            </a-row>
            <a-form-item
              style="width:50%;"
              :label-col="{ span: 12 }"
              :wrapper-col="{ span: 11, offset: 1 }"
              label="社会统一信用代码/注册号"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.logMerchantPosp.orgRegisterNo
              }}</span>
              <span v-else class="ant-form-text">{{
                queryDetail.logMerchantPosp.orgRegisterNo | creditNoFilter
              }}</span>
            </a-form-item>

            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="注册资本"
            >
              <span class="ant-form-text">{{
                queryDetail.logMerchantPosp.orgRegisterPrincipal
                  ? queryDetail.logMerchantPosp.orgRegisterPrincipal + "万"
                  : ""
              }}</span>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="成立日期"
            >
              <span class="ant-form-text">{{
                queryDetail.logMerchantPosp.createDate
              }}</span>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="营业期限"
            >
              <span class="ant-form-text"
                >{{ queryDetail.logMerchantPosp.orgExpiryDateStart }}--{{
                  queryDetail.logMerchantPosp.orgExpiryDateEnd
                }}</span
              >
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="主营业务"
            >
              <span class="ant-form-text">{{
                queryDetail.logMerchantPosp.mainBusiness
              }}</span>
            </a-form-item>

            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="营业执照地址"
            >
              <span v-if="sensitive=='0'" class="ant-form-text"
                >{{ queryDetail.logMerchantPosp.busiProvinceName }}--{{
                  queryDetail.logMerchantPosp.busiCityName
                }}--{{ queryDetail.logMerchantPosp.busiDistrictName }}--{{
                  queryDetail.logMerchantPosp.busiAddress
                }}</span
              >
              <span class="ant-form-text">
                {{ queryDetail.logMerchantPosp | otherfilter }}
              </span>
            </a-form-item>

            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="实际经营地址"
            >
              <span v-if="sensitive=='0'" class="ant-form-text"
                >{{ queryDetail.logMerchantPosp.realProvinceName }}--{{
                  queryDetail.logMerchantPosp.realCityName
                }}--{{ queryDetail.logMerchantPosp.realDistrictName }}--{{
                  queryDetail.logMerchantPosp.realAddress
                }}</span
              >
              <span v-else class="ant-form-text"
                >{{ queryDetail.logMerchantPosp|otherfilter2 }}</span
              >
            </a-form-item>

            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="经营场所"
            >
              <span class="ant-form-text">{{
                queryDetail.logMerchantPosp.placeRight
              }}</span>
            </a-form-item>

            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="经营场所面积"
            >
              <span class="ant-form-text">{{
                queryDetail.logMerchantPosp.placeArea
              }}</span>
            </a-form-item>

            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="员工人数"
            >
              <span class="ant-form-text">{{
                queryDetail.logMerchantPosp.orgEmployees
              }}</span>
            </a-form-item>
          </div>

          <div v-if="!isOrg">
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >申请人信息</a-col
              >
            </a-row>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="姓名"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.identity.identityName
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idName',
                  value: queryDetail.identity.identityName,
                }"
              ></a-hide-data>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件类型"
            >
              <span class="ant-form-text">{{ queryDetail.null }}身份证</span>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件号码"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.identity.identityNo
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idCard',
                  value: queryDetail.identity.identityNo,
                }"
              ></a-hide-data>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件有效期"
            >
              <span class="ant-form-text">{{
                queryDetail.identity.expiryDate
              }}</span>
            </a-form-item>
          </div>

          <div v-if="isOrg">
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >联系人信息</a-col
              >
            </a-row>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="姓名"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.logMerchantPosp.contactName
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idName',
                  value: queryDetail.logMerchantPosp.contactName
                }"
              ></a-hide-data>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="联系电话"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.logMerchantPosp.contactPhone
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'mobileNo',
                  value: queryDetail.logMerchantPosp.contactPhone
                }"
              ></a-hide-data>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="Email"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.logMerchantPosp.contactEmail
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'email',
                  value: queryDetail.logMerchantPosp.contactEmail,
                }"
              ></a-hide-data>
            </a-form-item>
          </div>

          <div v-if="isOrg">
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >法定代表人信息</a-col
              >
            </a-row>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="姓名"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.legalIdentity.identityName
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idName',
                  value: queryDetail.legalIdentity.identityName,
                }"
              ></a-hide-data>
            </a-form-item>

                        <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="国籍"
            >
              <span class="ant-form-text"
                >{{ queryDetail.legalIdentity.nation || nation }}</span
              >
            </a-form-item>


            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件类型"
            >
              <span class="ant-form-text">{{ queryDetail.null }}身份证</span>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件号码"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.legalIdentity.identityNo
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idCard',
                  value: queryDetail.legalIdentity.identityNo,
                }"
              ></a-hide-data>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件有效期"
            >
              <span class="ant-form-text">{{
                queryDetail.legalIdentity.expiryDate
              }}</span>
            </a-form-item>
          </div>

          <div v-if="isOrg">
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >实际控制人信息</a-col
              >
            </a-row>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="姓名"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.controlIdentity.identityName
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idName',
                  value: queryDetail.controlIdentity.identityName,
                }"
              ></a-hide-data>
            </a-form-item>
                               <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="国籍"
            >
              <span class="ant-form-text"
                >{{ queryDetail.controlIdentity.nation  || nation}}</span
              >
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件类型"
            >
              <span class="ant-form-text"
                >{{ queryDetail.controlIdentity.null }}身份证</span
              >
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件号码"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.controlIdentity.identityNo
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idCard',
                  value: queryDetail.controlIdentity.identityNo,
                }"
              ></a-hide-data>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件有效期"
            >
              <span class="ant-form-text">{{
                queryDetail.controlIdentity.expiryDate
              }}</span>
            </a-form-item>
          </div>
          <div v-if="isOrg">
            <div v-for="(item,index) in queryDetail.benefit" :key="index">
              <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >受益所有人{{index+1}}</a-col
              >
            </a-row>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="姓名"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                item.identityName
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idName',
                  value: item.identityName,
                }"
              ></a-hide-data>
            </a-form-item>

                   <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="国籍"
            >
              <span class="ant-form-text">{{item.nation || nation}}</span>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件类型"
            >
              <span class="ant-form-text"
                >身份证</span
              >
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件号码"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                item.identityNo
              }}</span>
              <a-hide-data
                v-else
                :params="{
                  type: 'idCard',
                  value: item.identityNo,
                }"
              ></a-hide-data>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="证件有效期"
            >
              <span class="ant-form-text">{{
                item.expiryDate
              }}</span>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="地址"
            >
              <span class="ant-form-text">{{item.provinceName}}--{{item.cityName}}--{{item.districtName}}--{{item.address}}</span>
            </a-form-item>
            </div>
          </div>
          <a-row>
            <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
              >结算账户信息</a-col
            >
          </a-row>
          <a-form-item
            v-if="queryDetail.logMerchantPosp.merchantType != 'small'"
            class="formItemWidth"
            v-bind="formItemLayout"
            label="账户类型"
          >
            <span class="ant-form-text">{{
              queryDetail.bankCard.isPrivate == true ? "对私" : "对公"
            }}</span>
          </a-form-item>
          <a-form-item
            v-if="isOrg"
            class="formItemWidth"
            v-bind="formItemLayout"
            label="账户所属"
          >
            <span class="ant-form-text">{{
              queryDetail.logMerchantPosp.legalPersonAccount == true
                ? "法人"
                : "非法人"
            }}</span>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="账户名称"
          >
            <span v-if="sensitive=='0'" class="ant-form-text">{{
              queryDetail.bankCard.accountName
            }}</span>
            <span v-else class="ant-form-text"><span v-if="queryDetail.bankCard.isPrivate">
                  <a-hide-data
                    :params="{ type: 'idName', value: queryDetail.bankCard.accountName }"
                  ></a-hide-data></span
                ><span v-if="!queryDetail.bankCard.isPrivate">{{
                  queryDetail.bankCard.accountName | accountfilter1
                }}</span></span>
          </a-form-item>
          <a-form-item class="formItemWidth"></a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="开户行名称"
          >
            <span class="ant-form-text">{{
              queryDetail.bankCard.bankName
            }}</span>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="开户行所在地"
          >
            <span class="ant-form-text"
              >{{ queryDetail.bankCard.province }}--{{
                queryDetail.bankCard.city
              }}</span
            >
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="支行名称"
          >
            <span class="ant-form-text">{{
              queryDetail.bankCard.bankBranchName
            }}</span>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="账号"
          >
             <span v-if="sensitive=='0'" class="ant-form-text">{{
              queryDetail.bankCard.cardNo
            }}</span>
            <a-hide-data
              v-else
              :params="{ type: 'bankCard', value: queryDetail.bankCard.cardNo }"
            ></a-hide-data>
          </a-form-item>
          <a-form-item
            class="formItemWidth"
            v-bind="formItemLayout"
            label="预留银行手机号"
          >
            <span v-if="sensitive=='0'" class="ant-form-text">{{
              queryDetail.bankCard.mobileNo
            }}</span>
            <a-hide-data
              v-else
              :params="{
                type: 'mobileNo',
                value: queryDetail.bankCard.mobileNo,
              }"
            ></a-hide-data>
          </a-form-item>
          <a-form-item
            v-if="
              queryDetail.logMerchantPosp.merchantType != 'small' &&
                queryDetail.cardholderIdentity
            "
            class="formItemWidth"
            v-bind="formItemLayout"
            label="持卡人身份证"
          >
            <span v-if="sensitive=='0'" class="ant-form-text">{{
              queryDetail.cardholderIdentity.identityNo
            }}</span>
            <a-hide-data
              v-else
              :params="{
                type: 'idCard',
                value: queryDetail.cardholderIdentity.identityNo,
              }"
            ></a-hide-data>
          </a-form-item>

          <div>
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >合作机构信息</a-col
              >
            </a-row>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="合作机构号"
            >
              <span class="ant-form-text">{{
                queryDetail.logMerchantPosp.agentCode
              }}</span>
            </a-form-item>
            <a-form-item
              class="formItemWidth"
              v-bind="formItemLayout"
              label="合作机构名称"
            >
              <span v-if="sensitive=='0'" class="ant-form-text">{{
                queryDetail.agent.merchantName
              }}</span>
              <span v-else class="ant-form-text">{{
                queryDetail.agent.merchantName | accountfilter1
              }}</span>
            </a-form-item>
          </div>

          <div>
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >申请开通产品</a-col
              >
            </a-row>
            <div>
              <a-form-item
                class="formItemWidth"
                v-for="(key,index) in queryDetail.feeTemplate" :key="index"
              >
                <span class="ant-form-text">{{ index }}</span>
              </a-form-item>
            </div>
            <a-row>
              <a @click="aClick" href="javascript:false;void(0)">查看费率信息</a>
            </a-row>
          </div>

          <div>
            <a-row>
              <a-col :xs="{ span: 24 }" :sm="{ span: 4 }" class="formGroupTitle"
                >POS交易权限</a-col
              >
            </a-row>
            <div v-for="(item, index) in queryDetail.transOptions" :key="index">
              <a-form-item class="formItemWidth">
                <span class="ant-form-text">{{ item.name }}</span>
              </a-form-item>
            </div>
          </div>

          <a-row>
            <a-button type="primary" :loading="loading" @click="download"
              >下载附件</a-button
            >
          </a-row>
        </a-form>
        <div style="text-align: center;">
          <a-button @click="backTransList">
            <a-icon type="double-left" />返回
          </a-button>
          <a-button
            v-if="
              queryDetail.logMerchantPosp.statusName == '初审不通过' ||
                queryDetail.logMerchantPosp.statusName == '审核不通过'
            "
            type="primary"
            style="width: 8vw;"
            @click="goToModify"
            size="large"
            >修改</a-button
          >
        </div>
      </div>
      <a-modal
      @ok="handleOk"
      @cancel="handleCancel"
      :visible="modalVisible"
      :footer="null"
      width="700px"
    >
      <div>
         <agent-rate-view :MerRateList="MerRateList" ref="getMerRateData"></agent-rate-view>
      </div>
    </a-modal>
    </a-spin>
    
  </div>
</template>

<script>






import { message } from "ant-design-vue";
import api from "@/common/api";
import { error } from "util";
import { fail } from "assert";
import AHideData from "../../common/HideData";
import AgentRateView from "../../common/AgentRateView";

export default {
  name: "orgMyInfo",
  components: {
    AHideData,
    AgentRateView
  },
  data() {
    return {
      nation: '中国',
      MerRateList:null,
      ratelist: [],
      iconLoading: false,
      loading: false,
      modalVisible: false,
      spinning: false,
      already: false,
      isOrg: true,
      queryDetail: {
        logMerchantPosp: {},
        agent: {},
        member: {},
        identity: {},
        controlIdentity: {},
        bankCard: {},
        legalIdentity: {}
      },
      formItemLayout: {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 8 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15, offset: 1 },
          md: { span: 15, offset: 1 }
        }
      },
      sensitive:localStorage.getItem("sensitive")
    };
  },
  watch: {},
  computed: {},
  filters: {
    creditNoFilter(value) {
      if (value) {
        var len = value.length;
        var firstStr = value.substr(0, 1);
        var lastStr = value.substr(-1);
        var middleStr = value
          .substring(1, len - Math.abs(-1))
          .replace(/[\s\S]/gi, "*");
        var tempStr = firstStr + middleStr + lastStr;
        return tempStr;
      }
    },
    otherfilter(value) {
      if (value.busiProvinceName) {
        let data =
          value.busiProvinceName +
          "-" +
          value.busiCityName +
          "-" +
          value.busiDistrictName +
          "-" +
          value.busiAddress;
        let len = data.length - 2;
        let arr = [];
        for (let i = 0; i < len; i++) {
          let item = "*";
          arr.push(item);
        }
        let arrstring = arr.join("");
        return (
          data.substring(0, 1) + arrstring + data.substring(data.length - 1)
        );
      }
    },
    otherfilter2(value) {
      if (value.realProvinceName) {
        let data =
          value.realProvinceName +
          "-" +
          value.realCityName +
          "-" +
          value.realDistrictName +
          "-" +
          value.realAddress;
        let len = data.length - 2;
        let arr = [];
        for (let i = 0; i < len; i++) {
          let item = "*";
          arr.push(item);
        }
        let arrstring = arr.join("");
        return (
          data.substring(0, 1) + arrstring + data.substring(data.length - 1)
        );
      }
    },
    accountfilter1(value) {
      if (value) {
          let len = value.length - 2;
          let arr = [];
          for (let i = 0; i < len; i++) {
            let item = "*";
            arr.push(item);
          }
          let arrstring = arr.join("");
          return (
            value.substring(0, 1) +
            arrstring +
            value.substring(value.length - 1)
          );
      }
    },
  },
  mounted() {
    let id = this.$route.params.id;
    this.getQueryDetail(id);
  },
  methods: {
    goModify() {
      this.query.verCode = null;
      this.visible = true;
    },
    getQueryDetail(id) {
      this.$axios.get("/agent/merchant/network/checkDetail/" + id).then(
        res => {
          console.log(res);
          if (res.data.code == "OK") {
            this.queryDetail = res.data.data;

            if (res.data.data.logMerchantPosp.merchantType == "small") {
              this.isOrg = false;
            } else {
              this.isOrg = true;
            }
          }
        },
        err => {}
      );
    },
   
    orgSubmit(e) {
      e.preventDefault();
      this.form.validateFields((err, values) => {
        if (!err) {
          api.coustromsendPhoneOrg(this.query, res => {
            if (res.code == "OK") {
              this.visible = false;
              this.$router.push("/org/infoset/allinfoChange");
            } else {
              this.$message.warning(res.message);
            }
          });
        }
      });
    },
    handleOk(e) {
      setTimeout(() => {
        this.modalVisible = false;
      }, 2000);
    },
    handleCancel(e) {
      this.modalVisible = false;
    },
    gologin() {
      this.visible = false;
      this.$router.push("/home");
    },
    backTransList() {
      this.$router.push("/OrgRegister/orgAuditQuery");
    },
    aClick() {
      this.modalVisible = true;
      setTimeout(()=>{
        this.setMerRateList()
      },1000)
      
    },
    setMerRateList(){
      this.MerRateList =  this.queryDetail.feeTemplate
    },
    download() {
      console.log("attachRequest", this.queryDetail.attachRequest);
      this.loading = true;
      this.$axios
        .post("/file/file/attach", this.queryDetail.attachRequest)
        .then(
          res => {
            this.loading = false;
            console.log("res", res);
            //   console.log("res.data.data:",res.data.data);
            if (res.data.data != null) {
              window.location.href = res.data.data;
            } else {
              this.$message.error("附件不存在");
            }
          },
          err => {
            this.loading = false;
            this.$message.error(err.message);
          }
        );
    },
    rowClassName(record, index) {
      if (
        record.protocolBankDTOList == null ||
        record.protocolBankDTOList.length == 0
      ) {
        return "noExpand";
      }
    },
    goToModify() {
      if (this.queryDetail.member.memberNo) {
        if (this.queryDetail.logMerchantPosp.merchantType == "small") {
          sessionStorage.setItem(
            "orgBMemberNo",
            this.queryDetail.member.memberNo
          );
          sessionStorage.setItem(
            "orgBMerchantName",
            this.queryDetail.agent.merchantName
          );
          sessionStorage.removeItem("orgAMemberNo");
          sessionStorage.removeItem("orgAMerchantName");

          this.$router.push("/OrgRegister/userTypeB/step1");
        } else {
          sessionStorage.setItem(
            "orgAMemberNo",
            this.queryDetail.member.memberNo
          );
          sessionStorage.setItem(
            "orgAMerchantName",
            this.queryDetail.agent.merchantName
          );
          sessionStorage.removeItem("orgBMemberNo");
          sessionStorage.removeItem("orgBMerchantName");
          this.$router.push("/OrgRegister/userTypeA/step1");
        }
      }
    }
  }
};
</script>

<style lang="less" scoped>
/deep/.noExpand {
  .ant-table-row-expand-icon {
    display: none;
  }
}

.card_sty {
  margin-bottom: 30px;
}

.mainContent {
  overflow-y: scroll;
  height: 100%;
  padding: 30px;
}

/* 滚动条样式 */
.mainContent::-webkit-scrollbar {
  width: 4px;
  height: 4px;
  scrollbar-arrow-color: red;
}

.mainContent::-webkit-scrollbar-thumb {
  border-radius: 5px;
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.2);
  scrollbar-arrow-color: red;
}

.mainContent::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.1);
}

span {
  cursor: pointer;
}

.formItemWidth {
  width: 30%;
}

.formGroupTitle {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  margin-top: 15px;
  text-align: left;
  /* margin-left: 20px; */
}

.ant-card-head-title {
  padding: 12px 0 !important;
}

.ant-card-grid {
  padding: 12px;
}

.ant-card-head {
  background: transparent;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 24px;
  border-radius: 2px 2px 0 0;
  zoom: 1;
  margin-bottom: -1px;
  min-height: 45px !important;
  font-size: 16px;
  color: #52506b;
  font-weight: 400;
  display: flex;
}

.ant-card .ant-card-grid:nth-child(4n + 1),
.ant-card .ant-card-grid:nth-child(4n + 2) {
  background: #f7f9fc;
}

.ant-card-grid:hover {
  /* box-shadow: none; */
  box-shadow: 1px 0 0 0 #e8e8e8, 0 1px 0 0 #e8e8e8, 1px 1px 0 0 #e8e8e8,
    1px 0 0 0 #e8e8e8 inset, 0 1px 0 0 #e8e8e8 inset;
}

.modalClass {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding-top: 40px;
  padding-bottom: 20px;
}

.modalClass h4 {
  color: #29a576;
  font-size: 22px;
  font-weight: 400;
  margin-top: 15px;
  margin-bottom: 25px;
}

.modalClass p {
  margin-bottom: 10px;
}
</style>
